
<span jwcid="tabs" /> 
<span jwcid="content@Block">
	<p jwcid="showTabbedContentAdvice"><span jwcid="@Insert" value="message:advice.selectbet"/></p>
	<table id="betTable">
	  <tr jwcid="bets">
	    <td><span jwcid="@Insert" value="ognl:entry.outcome.bet.event.label" /> <span jwcid="@Insert" value="ognl:entry.outcome.label" /></td>
	    <td><span jwcid="@InsertNumber" value="ognl:entry.odds"/></td>
	    <th><a jwcid="deleteBet"><img jwcid="@Image" image="asset:deleteImageAsset"/></a></th>
	  </tr>
	</table>
	<span jwcid="showTotalOdds">
		<span jwcid="@Insert" value="message:totalodds"/> <span id="totalOdds"><span jwcid="@InsertNumber" value="ognl:betSlip.totalOdds"/></span>
	</span>
</span>

<span jwcid="single@Block">
	<span jwcid="@RenderBlock" block="component:content" /> 
</span>

<span jwcid="multiple@Block">
	<span jwcid="@RenderBlock" block="component:content" />
</span>	

<form jwcid="betSlipForm">
	<span jwcid="betSlipErrors@ShowErrors" delegate="ognl:delegate" />
	<span jwcid="@ShowMessage" message="ognl:message"/>
	<table border="0" width="100%">
		<tr>
			<td><span jwcid="@FieldLabel" field="component:stake">Stake:</span></td>
			<td><input jwcid="stake" size="3" onkeyup="javascript:getProfit(this)"/></td>
		<tr>
		<tr>
			<td><label><span jwcid="@Insert" value="message:form.profit"/></label></td>
			<td><span id="profit">0.00</span></td>
		<tr>
		<tr>
			<td>&nbsp;</td>
			<td><input jwcid="confirmBet" class="button"/></td>
		</tr>
	</table>
</form>
<script type="text/javascript">
       dojo.require("tapestry.fx");
       dojo.require("dojo.lfx");
       tapestry.fx.attachPostEffect("tabs", function(){return dojo.lfx.highlight("box", [255, 250, 180]) });
       tapestry.fx.attachPostEffect("betSlipErrors", function(){return dojo.lfx.highlight("betSlipErrors", [255, 180, 180]) });
</script>

<script type="text/javascript">
		dojo.require("dojo.i18n.number");
       	function getProfit(field){
	       	var locale = null;
       		if(djConfig.locale!=null){
	       		if(dojo.string.has(djConfig.locale, "-")){
	       			locale = djConfig.locale;
	       		}else{
	       			var l = djConfig.locale+"-"+djConfig.locale;
	       			if(dojo.i18n.number.FORMAT_TABLE[l]!=null){
	       				locale = l;
	       			}
	       		}
       		}
       		var totalOdds = document.getElementById("totalOdds");
       		if(totalOdds!=null){
       			var odds = dojo.i18n.number.parse(totalOdds.textContent, locale);
       			var stake = dojo.i18n.number.parse(field.value, locale);
       			var profit = odds*stake;
       			if(!isNaN(profit)){
       				document.getElementById("profit").textContent=profit;
       			}
       		}
       	}
</script>
<span jwcid="stylesheet"/>
<div style="display: none;">
	<div jwcid="confirmationDialog">
		<div style="width:300px;">
			<form jwcid="confirmForm">
				<h2><span jwcid="@Insert" value="message:confirm.advice"/></h2>
				<span jwcid="betSlipDetails"/>
				<span jwcid="betSlipItems"/>
				<center><input jwcid="confirm" class="button"/>&nbsp;&nbsp;<input jwcid="cancelConfirm" class="button"/></center>
			</form>
		</div>
	</div>
</div>
